<?php session_start();?>
<fieldset>
		<legend>SUPPRESSION DE MEMBRES</legend>
		<form id="formMembresDel" class="formGestion" action="admin/membres/supprMembres.php" method="post">
			<table id="tableDel" class="suppression">
				<th class="green">Type</th>
				<th class="green">Identifiant</th>
				<th class="green">Nom/Prenom</th>
				<th class="green">NewsLetter</th>
				<th class="green">Telephone</th>
				<th class="green">Adresse</th>
				<th class="green">Mail</th>		
				<th class="green">Supprimer</th>
					<?php
					require_once ('../../connexion.php');
					try{
						$sql='SELECT * FROM membres  WHERE login!=:login ORDER BY type';
						$select = $connection->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
						$select->execute(array(':login' => $_SESSION['login']));
						while($enregistrement = $select->fetch(PDO::FETCH_OBJ)){
							?>			
								<tr>
									<td><?php echo $enregistrement->type;?></td>
									<td><?php echo $enregistrement->login;?></td>
									<td><?php echo $enregistrement->civilite." ".$enregistrement->nom." ".$enregistrement->prenom;?></td>
									<td><?php echo $enregistrement->newsletter;?></td>
									<td><?php echo $enregistrement->telephone;?></td>
									<td><?php echo $enregistrement->codePostal." ".$enregistrement->ville." ".$enregistrement->adresse;?></td>
									<td><?php echo $enregistrement->mail;?></td>
									
									<td>
										<input title="Cocher pour supprimer" id="<?php echo $enregistrement->login;?>" name="actusBox[]" value="<?php echo $enregistrement->login;?>" class="css-checkbox" type="checkbox" />
										<label id="<?php echo $enregistrement->login;?>" for="<?php echo $enregistrement->login;?>" class="css-label">Non</label>
									</td>
								</tr>			
							<?php 
						}
					}catch(Exception $e){
						echo "<h3 class='error'>Impossible de charger les membres</h3>";
					}
					?>
				<tr>
					<td class="blackAction" colspan="8">
						<input class="inputAction" type="submit" value="Sauvegarder"/>
						<input id="btnResetDel" class="inputAction" type="reset" value="Rien cocher"/>
						<a class="action" id="btnAllCheck">Tout cocher</a>
					</td>	
				</tr>
			</table>
		</form>
</fieldset>
